<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>购物车详情</title>
    <link rel="stylesheet" href="/favicon.ico">
    <link rel="stylesheet" href="/libs/font/iconfont.css">
    <link rel="stylesheet" href="/libs/bootstrap/css/bootstrap-responsive.min.css">
    <link rel="stylesheet" href="/libs/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/css/cart.css">
</head>
<body>
    <header></header>
    <div class="head">
        <div class="container">
           <div class="left">我的购物车</div>
           <div class="right"></div>
        </div>
    </div>
    <main>
        <div class="container">
            <div class="isLogin">
                您还没有登录！登录后可查看之前加入的商品 
                <a href="/html/login.html" target="_blank">登录</a>
            </div>
            <table class="table-striped">
                <thead>
                    <tr>
                        <th><label>全选:<input type="checkbox" id="allCheck" checked></label></th>
                        <th>商品</th>
                        <th>单价</th>
                        <th>数量</th>
                        <th>小计</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>       
         
                </tbody>  
                <script type="text/html" id="detailTemplate">
                    {{if cart}}
                    {{each cart item}}
                    <tr data-id="{{item.id}}">
                        <td>
                            <input type="checkbox" class="check" checked>
                            <a href="/html/commodityDetails.html?id={{item.id}}" target = "_blank"><img src="{{item.image}}" alt=""></a>
                        </td>
                        <td>
                            <p>{{item.title}}</p>
                            <p>{{item.introduction}}</p>
                            <p>{{item.accessoryHints.join(' ')}}</p>
                            <span>分期免息</span>    
                        </td>
                        <td>¥<span class="price">{{item.price.toFixed(2)}}</span></td>
                        <td>
                            <button class="subBtn">-</button>
                            <input type="text" value="{{item.count}}" class="numGood">
                            <button class="addBtn">+</button>
                        </td>
                        <td class="goodPrice">
                            {{(item.price*item.count).toFixed(2)}}
                        </td>  
                        <td><span class="edit">删除</span></td>           
                    </tr>
                    {{/each}}
                    {{else}}
                    <tr class="nothing">
                        <td colspan = "6">
                            <span>购物车为空:返回<a href="/index.html">首页</a>挑选商品</span>
                        </td>                       
                    </tr>
                    {{/if}}
                </script>              
           </table>            
        </div>
    </main>
    <div class="foot">
        <div class="container">
            <div class="left">
                <label><input type="checkbox" id="allCheck1" class="allCheck" checked>全选</label>
            </div>
            <div class="right">                                
                总价：￥ 
                <b id="money"></b>
                共选<span class="goodNum"></span>件
                <button>立即结算</button>
            </div>
        </div>
    </div>
    <footer class="container footer"></footer>
    <script src="/libs/require/require.min.js" data-main="/js/cart.js"></script>
</body>
</html>